Optimal. Leaf size=116 \[ \frac {17 a^4 x}{8}-\frac {4 a^4 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {4 a^4 \cos (c+d x)}{d}-\frac {4 a^4 \cos ^3(c+d x)}{3 d}-\frac {a^4 \cot (c+d x)}{d}+\frac {23 a^4 \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^4 \cos (c+d x) \sin ^3(c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2788, 3855,
3852, 8, 2715, 2713} \begin {gather*} -\frac {4 a^4 \cos ^3(c+d x)}{3 d}+\frac {4 a^4 \cos (c+d x)}{d}-\frac {a^4 \cot (c+d x)}{d}+\frac {a^4 \sin ^3(c+d x) \cos (c+d x)}{4 d}+\frac {23 a^4 \sin (c+d x) \cos (c+d x)}{8 d}-\frac {4 a^4 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {17 a^4 x}{8} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2788
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx &=\frac {\int \left (5 a^6+4 a^6 \csc (c+d x)+a^6 \csc ^2(c+d x)-5 a^6 \sin ^2(c+d x)-4 a^6 \sin ^3(c+d x)-a^6 \sin ^4(c+d x)\right ) \, dx}{a^2}\\ &=5 a^4 x+a^4 \int \csc ^2(c+d x) \, dx-a^4 \int \sin ^4(c+d x) \, dx+\left (4 a^4\right ) \int \csc (c+d x) \, dx-\left (4 a^4\right ) \int \sin ^3(c+d x) \, dx-\left (5 a^4\right ) \int \sin ^2(c+d x) \, dx\\ &=5 a^4 x-\frac {4 a^4 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {5 a^4 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a^4 \cos (c+d x) \sin ^3(c+d x)}{4 d}-\frac {1}{4} \left (3 a^4\right ) \int \sin ^2(c+d x) \, dx-\frac {1}{2} \left (5 a^4\right ) \int 1 \, dx-\frac {a^4 \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}+\frac {\left (4 a^4\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {5 a^4 x}{2}-\frac {4 a^4 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {4 a^4 \cos (c+d x)}{d}-\frac {4 a^4 \cos ^3(c+d x)}{3 d}-\frac {a^4 \cot (c+d x)}{d}+\frac {23 a^4 \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^4 \cos (c+d x) \sin ^3(c+d x)}{4 d}-\frac {1}{8} \left (3 a^4\right ) \int 1 \, dx\\ &=\frac {17 a^4 x}{8}-\frac {4 a^4 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {4 a^4 \cos (c+d x)}{d}-\frac {4 a^4 \cos ^3(c+d x)}{3 d}-\frac {a^4 \cot (c+d x)}{d}+\frac {23 a^4 \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^4 \cos (c+d x) \sin ^3(c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.12, size = 136, normalized size = 1.17 \begin {gather*} \frac {a^4 \csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (-48 \cos (c+d x)-147 \cos (3 (c+d x))+3 \cos (5 (c+d x))+408 c \sin (c+d x)+408 d x \sin (c+d x)-768 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+768 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+320 \sin (2 (c+d x))-32 \sin (4 (c+d x))\right )}{384 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 136, normalized size = 1.17
method | result | size |
derivativedivides | \(\frac {a^{4} \left (-\cot \left (d x +c \right )-d x -c \right )+4 a^{4} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+6 a^{4} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {4 \left (\cos ^{3}\left (d x +c \right )\right ) a^{4}}{3}+a^{4} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}\) | \(136\) |
default | \(\frac {a^{4} \left (-\cot \left (d x +c \right )-d x -c \right )+4 a^{4} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+6 a^{4} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {4 \left (\cos ^{3}\left (d x +c \right )\right ) a^{4}}{3}+a^{4} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}\) | \(136\) |
risch | \(\frac {17 a^{4} x}{8}-\frac {3 i a^{4} {\mathrm e}^{2 i \left (d x +c \right )}}{4 d}+\frac {3 a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {3 a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {3 i a^{4} {\mathrm e}^{-2 i \left (d x +c \right )}}{4 d}-\frac {2 i a^{4}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {4 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {4 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {a^{4} \sin \left (4 d x +4 c \right )}{32 d}-\frac {a^{4} \cos \left (3 d x +3 c \right )}{3 d}\) | \(174\) |
norman | \(\frac {-\frac {a^{4}}{2 d}+\frac {17 a^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {27 a^{4} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {27 a^{4} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {17 a^{4} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {a^{4} \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {17 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8}+\frac {17 a^{4} x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {51 a^{4} x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {17 a^{4} x \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {17 a^{4} x \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {16 a^{4} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {16 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d}+\frac {64 a^{4} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {4 a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(289\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 117, normalized size = 1.01 \begin {gather*} -\frac {128 \, a^{4} \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{4} - 144 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4} + 96 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{4} - 192 \, a^{4} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{96 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 135, normalized size = 1.16 \begin {gather*} \frac {6 \, a^{4} \cos \left (d x + c\right )^{5} - 81 \, a^{4} \cos \left (d x + c\right )^{3} - 48 \, a^{4} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 48 \, a^{4} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 51 \, a^{4} \cos \left (d x + c\right ) - {\left (32 \, a^{4} \cos \left (d x + c\right )^{3} - 51 \, a^{4} d x - 96 \, a^{4} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 194, normalized size = 1.67 \begin {gather*} \frac {51 \, {\left (d x + c\right )} a^{4} + 96 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 12 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {12 \, {\left (8 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{4}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (69 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 93 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 192 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 93 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 256 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 69 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 64 \, a^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.83, size = 295, normalized size = 2.54 \begin {gather*} \frac {4\,a^4\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {17\,a^4\,\mathrm {atan}\left (\frac {289\,a^8}{16\,\left (34\,a^8-\frac {289\,a^8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}\right )}+\frac {34\,a^8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{34\,a^8-\frac {289\,a^8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}}\right )}{4\,d}+\frac {-\frac {25\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{2}-\frac {39\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{2}+32\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {19\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+\frac {128\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {15\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+\frac {32\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}-a^4}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+12\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________